class Blog < ActiveRecord::Base
  include ConfigManager
  
  with_options(:order => 'published_at DESC') do |this|
    this.has_many :articles
    this.has_many :comments
  end
  
  belongs_to :user
  serialize :settings, Hash
  
  setting :blog_name,           :string, 'trinit.cn'
  setting :copy_right,          :string, 'Copyright &copy; 2007-2008. Trinit.cn. All rights reserved.'
  setting :blog_url,            :string, 'http://localhost:3000/u/b'
  
  # articles
  setting :page_article_count,  :integer, 10
  
  
  def initialize()
    super
    self.settings ||= {}
  end
end